package com.gzq.builder.practice;

import java.util.ArrayList;
import java.util.List;

public abstract class ProductAbstract {

    private List<String> indexes = new ArrayList<>();

    public void setIndexes(List<String> indexes) {
        this.indexes = indexes;
    }

    public abstract void lighting();
    public abstract void whistle();
    public abstract void boom();

    public  void run(){
        for(String str : indexes){
            if ("lighting".equalsIgnoreCase(str)){
                this.lighting();
            }
            if ("whistle".equalsIgnoreCase(str)){
                this.whistle();
            }
            if ("boom".equalsIgnoreCase(str)){
                this.boom();
            }
        }
    }


}
